package com.smartHome.mapper;

import com.smartHome.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface UserMapper {
    @Select("select * from users where email = #{email}")
    User findByEmail(String email);

    @Insert("insert into users(username,password,email,create_time,update_time)" +
            "values (#{username},#{password},#{email},now(),now())")
    void add(User user);


    void update(User user);
}
